export default function(code: number, msg: string, data: object = null) {
  return {
    code,
    msg,
    data: code === 0 ? data : undefined,
  };
}
